package me.leiusual.sharing.ui.setting

import androidx.lifecycle.ViewModel
import dagger.Binds
import dagger.Module
import dagger.android.ContributesAndroidInjector
import dagger.multibindings.IntoMap
import me.leiusual.sharing.di.FragmentScope
import me.leiusual.sharing.di.ViewModelKey

/**
 * author: leiusual
 * create on: 2018/10/15
 * description:
 */
@Module
abstract class SettingModule {

  @FragmentScope
  @ContributesAndroidInjector
  abstract fun settingAboutFragment(): SettingAboutFragment

  @Binds
  @IntoMap
  @ViewModelKey(SettingAboutViewModel::class)
  abstract fun settingAboutViewModel(settingAboutViewModel: SettingAboutViewModel): ViewModel

  @FragmentScope
  @ContributesAndroidInjector
  abstract fun settingContactFragment(): SettingContactFragment

  @FragmentScope
  @ContributesAndroidInjector
  abstract fun settingPasswordFragment(): SettingPasswordFragment

  @Binds
  @IntoMap
  @ViewModelKey(SettingPasswordViewModel::class)
  abstract fun settingPasswordViewModel(settingPasswordViewModel: SettingPasswordViewModel): ViewModel

  @FragmentScope
  @ContributesAndroidInjector
  abstract fun settingHomeFragment(): SettingHomeFragment

  @Binds
  @IntoMap
  @ViewModelKey(SettingHomeViewModel::class)
  abstract fun settingHomeViewModel(settingHomeViewModel: SettingHomeViewModel): ViewModel
}